<!DOCTYPE html>

<head>
    <meta charset="UTF-8">
    <title>创建简单元素</title>
    <script src="jQuery-3.6.3.min.js"> </script>
    <script>
        $(function () {

            $("#a2").click(function () {
    

               $("ul").before("<li> 980</li>");
            })

        });
    </script>
</head>

<body>
    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li id="a1">4</li>
        <li>5</li>9 
    </ul>
    <input id="a2" type="button" value="创建元素" />
</body>

</html>